package cs575.wido.model;

import cs575.wido.TaskListFactory;

public class PendingTaskModel extends TaskModel {

    public PendingTaskModel(TaskListFactory factory) {
        super();
        tasks = factory.getTaskList();
    }

    @Override
    public int getRowCount() {
        return tasks.size();
    }

    @Override
    public Object getValueAt(int arg0, int arg1) {
        System.out.println(arg0 + " : " + arg1);
        switch (arg1) {
            case 0:
                return tasks.get(arg0).getTaskName();
            case 1:
                return tasks.get(arg0).getTaskDescription();
            case 2:
                return (tasks.get(arg0).getStatus() == 1 ? "Active" : "Completed");
            case 3:
                return tasks.get(arg0).getDueDate().toString();
        }
        return "";
    }
}
